package com.study.feign;

import com.study.account.AddressInfo;
import com.study.common.TableId;
import com.study.feign.hystrix.AddressClientHystrix;
import com.study.vo.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 用户账号服务 feign
 */
@FeignClient(
        contextId = "AddresClient",
        value = "ecommerce-account-service",
        fallback = AddressClientHystrix.class
)
public interface AddresClient {

    @RequestMapping(
            value = "ecommerce-account-service/address/address-info-by-table-id",
            method = RequestMethod.POST
    )
    public CommonResponse<AddressInfo> getAddressInfoByTableId(@RequestBody TableId tableId);
}
